<template>
  <div>
    <van-nav-bar
      title="商品详情"
      left-text="返回"
      left-arrow
      :fixed="true"
      @click-left="$router.go(-1)"
    />
    <div class="main" v-for="value in getdesc" :key="value.title">
      <div class="title">{{ value.title }}</div>
      <div class="content" v-html="value.content"></div>
    </div>
  </div>
</template>

<script>
import { shoppGetdesc } from "@/apis/get";
export default {
  data() {
    return {
      getdesc: [],
    };
  },
  mounted() {
    console.log(this.$route.params.id);
    shoppGetdesc(this.$route.params.id).then((res) => {
      // const pattern = /rowspan=.*>/;
      // console.log(res.data.message[0].content.replace);
      // res.data.message[0].content = res.data.message[0].content.repalce(
      //   pattern,
      //   ""
      // );

      this.getdesc = res.data.message;
    });
  },
};
</script>

<style lang="less" scoped>
.main {
  margin-top: 40px;
  .title {
    color: #26a2ff;
    line-height: 30px;
    font-size: 20px;
    font-weight: 700;
    padding: 20px;
    border: 1px solid rgb(194, 194, 194);
  }
  .content {
    padding: 20px;
    /deep/ p {
      line-height: 32px;
    }
    /deep/ img {
      width: 100%;
    }
    /deep/ .dingwei {
      width: 100%;
    }
    /deep/ .heise14 {
      line-height: 32px;
    }
  }
}
/deep/ .van-nav-bar__content {
  background-color: #26a2ff;

  .van-nav-bar__text,
  .van-icon {
    color: #fff;
  }
}
/deep/ .van-nav-bar__title {
  color: #fff;
}
</style>